#ifndef _MY_CAMERA_H_
#define _MY_CAMERA_H_
#include "cocos2d.h"
#include "CMemoryFile.h"

using namespace cocos2d;
using namespace io;

namespace fireplane
{
	class Camera : public CCNode
	{
	public:
		Camera();
		~Camera();

		static Camera* getCamera(){
			return _s_Camera;
		}

		void init();
		void update(float dt);

		void loadMap(int level);

		CCNode* getAllBulletParent(){
			return _all_bullet_parent;
		}

		CCNode* getAllEnemyParent(){
			return _all_enemy_parent;
		}

		CCNode* getHeroNode()
		{
			return _hero_node;
		}

		CCNode* getEffectNode(){
			return _all_effect_node;
		}

		void _loadBg(CMemoryFile* file,int level);
		void _loadSceneObject(CMemoryFile* file,int level);

		void createSceneObject(string buffer,
			float x,float y,int z,float angle,float x_s,float y_s,int level,
			CCNode* parentNode);

		void setMoveEnableFlag(bool f){_enable_move = f;}
	private:
		CCNode* _all_bullet_parent;

		CCNode* _all_map_node;
		CCNode* _all_backgroud;
		CCNode* _all_scene_object;
	
		CCNode* _hero_node;

		CCNode* _all_enemy_parent;
		CCNode* _all_effect_node;

		bool _enable_move;
		static Camera* _s_Camera;
	};
}

#endif